<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
function Person (name) {
    this.name = name
}

let p1 = new Person(1)

function myInstanceof (obj1, obj2) {
    if (!obj1.__proto__) return false
    if (p1.__proto__ === Person.prototype) {
        return true
    } else {
        myInstanceof(obj1.__proto__, obj2)
    }
}

console.log(p1 instanceof Person)
console.log(myInstanceof(p1, Person))
// console.log(p1.__proto__ === Person.prototype)

console.log(111111)

console.log(p1 instanceof Object)
console.log(myInstanceof(p1, Object))
</script>
</body>
</html>